package dao

import (
	"time"
)

// 这是 UmsMemberStatisticsInfo 的全局公开dao对象，被service层调用!
var UmsMemberStatisticsInfoDao = umsMemberStatisticsInfoDao{}

// 会员统计信息
// 这是 ums_member_statistics_info表 的实体类
type UmsMemberStatisticsInfo struct {
	AttendCount         int32     `json:"attend_count" form:"attend_count" v:"attend_count"` // 关注数量
	CollectCommentCount int32     `json:"collect_comment_count" form:"collect_comment_count" v:"collect_comment_count"`
	CollectProductCount int32     `json:"collect_product_count" form:"collect_product_count" v:"collect_product_count"`
	CollectSubjectCount int32     `json:"collect_subject_count" form:"collect_subject_count" v:"collect_subject_count"`
	CollectTopicCount   int32     `json:"collect_topic_count" form:"collect_topic_count" v:"collect_topic_count"`
	CommentCount        int32     `json:"comment_count" form:"comment_count" v:"comment_count"`    // 评价数
	ConsumeAmount       float64   `json:"consume_amount" form:"consume_amount" v:"consume_amount"` // 累计消费金额
	CouponCount         int32     `json:"coupon_count" form:"coupon_count" v:"coupon_count"`       // 优惠券数量
	FansCount           int32     `json:"fans_count" form:"fans_count" v:"fans_count"`             // 粉丝数量
	Id                  int64     `json:"id" form:"id" v:"id"`
	InviteFriendCount   int32     `json:"invite_friend_count" form:"invite_friend_count" v:"invite_friend_count"` // 邀请好友计数
	LoginCount          int32     `json:"login_count" form:"login_count" v:"login_count"`                         // 登录次数
	MemberId            int64     `json:"member_id" form:"member_id" v:"member_id"`                               // 这是一个逻辑外键,关联ums_member(id)
	OrderCount          int32     `json:"order_count" form:"order_count" v:"order_count"`                         // 订单数量
	RecentOrderTime     time.Time `json:"recent_order_time" form:"recent_order_time" v:"recent_order_time"`       // 最后一次下订单时间
	ReturnOrderCount    int32     `json:"return_order_count" form:"return_order_count" v:"return_order_count"`    // 退货订单数

}

// 注意:这是 UmsMemberStatisticsInfo 的私有dao对象，只能在dao层内使用!
type umsMemberStatisticsInfoDao struct {
	InsertTemplate func(arg UmsMemberStatisticsInfo) (int64, error)                               //插入一条记录
	UpdateTemplate func(arg UmsMemberStatisticsInfo) (int64, error)                               //更新一条记录
	DeleteTemplate func(id int64) (int64, error)                                                  `args:"id"`                         //根据传入的主键删除一条记录
	SelectTemplate func(id int64) (UmsMemberStatisticsInfo, error)                                `args:"id"`                         //根据传入的主键获取一条记录
	List           func(keyword string, pageNum, pageSize int) ([]UmsMemberStatisticsInfo, error) `args:"keyword,page_num,page_size"` //模糊分页查询
}

/*
// 这是 ums_member_statistics_info 表的Postman测试参数
// 该结构体中的字段就是: 前后端交互的json字段!
type UmsMemberStatisticsInfoPostman struct {
attend_count
collect_comment_count
collect_product_count
collect_subject_count
collect_topic_count
comment_count
consume_amount
coupon_count
fans_count
id
invite_friend_count
login_count
member_id
order_count
recent_order_time
return_order_count

}*/

// 这是 ums_member_statistics_info 表的批量请求参数
type UmsMemberStatisticsInfoReq struct {
	List []UmsMemberStatisticsInfo `json:"list" form:"list"`
}
